package com.spark.bipay.constant;

public enum CoinTransferType {
    HDZ("195","HDZ","TWUMqXoHaat7EtjwwqpqVigoNa2ETbnGaD"),
    CNHD("2510","CNHD","0x80c651486660e5b529e29b00086292185929cb1f"),
    HDC("2510","HDC","0x0d19c4d326c94f588b55f1811e489a3a924e4acf"),
    ZYDC("2510","ZYDC","0x6bd3489c14de1c08a17e13f937108d4140666a3c"),
    ALEOTZ("2510","ALEOTZ","0x7e4d91a012dd2e33549e9ca91221ad2989ec7bad"),
    DSH("2510","DSH","0x901f894499ea329d0b8d6165182969c61add19db");

    //test
//    trx("195","trx","195");
    private String code;
    private String unit;
    private String contract;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getContract() {
        return contract;
    }

    public void setContract(String contract) {
        this.contract = contract;
    }

    CoinTransferType(String code, String unit, String contract){
        this.code=code;
        this.unit=unit;
        this.contract=contract;
    }

    public static CoinTransferType unitOf(String unit){
        switch (unit){
            case "HDZ": return HDZ;
            case "CNHD": return CNHD;
            case "HDC": return HDC;
            case "ZYDC": return ZYDC;
            case "DSH": return DSH;
            case "ALEOTZ": return ALEOTZ;
        }
        return null;
    }

}
